import get from 'lodash/get';
import set from 'lodash/set';
import has from 'lodash/has';
export const ensureAttr=function(obj,path='',defVal){
    if(has(obj,path)){
        return get(obj,path);
    }
    set(obj,path,defVal);
    return defVal;
};
export default ensureAttr;